/* RMIClient.java 
* Created on Dec 13, 2012 
*@Author: Mr.Viet 
*@Phone: 01683430426 
*@Email: phamvanvietcdhd@gmail.com
*/ 
package com.session8; 

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.jar.Attributes.Name;

public class RMIClient {

	public RMIClient() {
	}

	public static void main(String[] args) {
		try {
			IGateWay g = (IGateWay)Naming.lookup("rmi://localhost:2012/xxx");
			int total = g.add(10, 20);
			System.out.println(total);
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (NotBoundException e) {
			e.printStackTrace();
		}
		
		
	}

}
